<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-menu default-active='active' mode='horizontal' class='menu-unit'>
      <el-menu-item v-for='item in Container1' :index="'关联检测项目'===item.name?'active':'default'">
        <el-link @click="gotoMenu(item.url)" :type="'关联检测项目'===item.name?'primary':'default'">{{item.page_desc||item.name}}</el-link>
      </el-menu-item>
    </el-menu>
    <table cellpadding="4" cellspacing="0" border="0" width="100%">
      <tr>
        <td class="containerBack">
          <el-form ref="form" :model="s_step" :rules="rules" label-width="100px" id="mvcfm">
            <div class="form-unit">
              <span class="mvc-title-left"> 关联检测项目 </span>
            </div>
            <el-table :data="s_step">
              <el-table-column label="" prop="step_id" width="7">
                <template slot-scope="scope">
                </template>
              </el-table-column>
              <el-table-column label="#" align="center" type='index'>
              </el-table-column>
              <el-table-column label="检测项目" prop="description">
              </el-table-column>
            </el-table>
            <el-button @click="relationTestingItemsNextSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>保存</el-button>
          </el-form>
        </td>
      </tr>
    </table>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'RelationTestingItemsNext',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        s_step: [],
        loading: false,
        Container1: null,
        rules: {}
      }
    },
    created() {
      this.getData();
      this.loadContainerMenu({
        pid: "28847805EE1D403DBCD43478FD18BD08",
        name: "检测项目增加",
        selected: "关联检测项目"
      }, 'Container1', this.vueparams);
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/mes/product/TechnologyAction/relationTestingItemsNext?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      relationTestingItemsNextSubmit(_params) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            request({
              method: 'post',
              url: '/xcapi/VUEAction/mes/product/TechnologyAction/relationTestingItemsNextSubmit?' + _params + this.vueparams,
              data: this.postData()
            }).then(data => {
              this.gotoPage("/mes/product/TestingItemsStandMang/testingItemsStandMang?" + this.vueparams, data);
              this.msgSuccess(data.msg);
            })
          } else {
            this.msgError("必填项错误");
          }
        });
      },
    },
  }
</script>
